<template>
	<div class="listEditTitQueryBtnWrap">
        <el-button 
            v-for="(item,index) in formType"
            :key="index"
            :type="nowClick == index ? 'primary':''"
            @click="typeBtnClick(item,index)">
            {{item.name}}
        </el-button>
	</div>
</template>
<script type="text/javascript">
	
	export default{
		data () {
			return {
				nowClick:0,
                formType:[
                    {type:"Input",name:"输入框"},
                    {type:"Select",name:"选择器"},
                    {type:"DatePicker",name:"日期选择器"},
                    {type:"DateTimePicker",name:"日期时间选择器"},
                    {type:"datetimerange",name:"日期时间范围选择器"},
                    {type:"TimePicker",name:"时间选择器"},
                    {type:"TimeSelect",name:"时间选择"},
                ]
			}
		},
		mounted (){
            this.$mitt.emit("listBtnSelect",this.formType[this.nowClick]);
        },
        watch:{
            
        },
		components : {
			
		},
		methods : {
			typeBtnClick(item,index){
                this.nowClick = index;
                this.$mitt.emit("listBtnSelect",item);
            }
		}
	}
</script>
<style type="text/css" lang="less">
	.listEditTitQueryBtnWrap{
        .el-button{
            margin:0px 0 10px 10px;
        }
    }
</style>